const allowpage= ['/','/index','/admin' ,'/doAdmin','/register','doRegister'];
let localfilter = async (ctx,next)=>{
    let url = ctx.originalUrl;
    if(allowpage.indexOf(url)>-1){
        await next();
    } else {
        if(ctx.cookies.get("name")) {
            await next();
        } else {
            ctx.redirect("/index");
        }
    }
}
module.exports = localfilter;